<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>  </title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
    <script>
        arr=[1,2,3];
        arr.unshift(4); //在最前面添加一个新元素
        console.log('unshift:'+arr);

        arr.shift(4);   //删除第一个元素
        console.log('shift:'+arr);

        arr.push(4);    //在最后添加一个新元素
        console.log('push:'+arr);

        arr.pop(4);     //删除最后一个元素
        console.log('pop:'+arr);


    </script>
</body>
</html>
